﻿#include "rec_rw_factroy.h"

CRecWriteBase * CRecWriteFactory::GetRecorderInstance(int recordFileType,int channel)
{
	switch(recordFileType)
	{
	case RECORD_FILE_STFS:	//默认生成线性录像文件
		return new CRecordWriter(channel);
		break;
	case RECORD_FILE_AVI:
		return new CAviFileWrite(channel);
// 	case RECORD_FILE_ASF:    //微软ASF文件　同样是基本线性文件
// 		return new CAsfFile(channel);
// 		break;
	}
	return NULL;
}

CRecReadBase * CRecWriteFactory::GetReaderInstance(int recordFileType,int channel,int clientID)
{
	switch(recordFileType)
	{
	case RECORD_FILE_STFS:	//默认生成线性录像文件
		return new CRecordReader(clientID,channel);
		break;
	case RECORD_FILE_AVI:
		return new CRecReadAvi(clientID,channel);
// 	case RECORD_FILE_ASF:    //微软ASF文件　同样是基本线性文件
// 		return new CRecReadASF(clientID,channel);
// 		break;
	}
	return NULL;
}
